package com.bawei.module_documents.manager.model

import com.bawei.library_net.RetrofitManager
import com.bawei.module_documents.manager.entity.RequestEntity
import com.bw.documents.manager.entity.*
import okhttp3.MultipartBody
import okhttp3.RequestBody
import retrofit2.http.Body
import retrofit2.http.Multipart
import retrofit2.http.POST
import retrofit2.http.Part

/**
 * @Author : 
 * @Time : On 2023/7/29 11:16
 * @Description : FileService
 */
class FileService {
    private val api:FileApi
    init {
        api = RetrofitManager.instance.create(FileApi::class.java)
    }
    //查询文件

    suspend fun requestSelDocuments(request: RequestEntity): DocumentsResponseEntity{
        return api.requestSelDocuments(request)
    }
//    //添加文件
//    @POST("document/uploaddocuments")
//    suspend fun requestInsertDocuments(@Body body: RequestBody): InsertDocumentsEntity
//    //上传文件
    suspend fun requestUploadDocuments( data:MultipartBody.Part): UploadDocumentsEntity{
        return api.requestUploadDocuments(data)
    }
//    //删除文件
//    @POST("document/deldocuments")
//    suspend fun requestDelDocuments(@Body body: RequestBody): DelDocumentsEntity
//    //同步文件
//    @POST("document/syncdocuments")
//    suspend fun requestSyncDocuments(@Body body: RequestBody): SyncDocumentsEntity
}